package cn.itsource.pethome.system.service.impl;

import cn.itsource.pethome.base.service.impl.BaseServiceImpl;
import cn.itsource.pethome.system.domain.Detail;
import cn.itsource.pethome.system.mapper.DetailMapper;
import cn.itsource.pethome.system.query.DetailQuery;
import cn.itsource.pethome.system.query.ProductQuery;
import cn.itsource.pethome.system.service.IDetailService;
import cn.itsource.pethome.util.PageList;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DetailServiceImpl extends BaseServiceImpl<Detail> implements IDetailService {
    @Autowired
    private DetailMapper detailMapper;


    @Override
    public PageList<Detail> pageTypeOne(DetailQuery detailQuery) {
        List<Detail> details = detailMapper.pageTypeOne(detailQuery);
        Long aLong = detailMapper.count1(detailQuery.getId());
        PageList<Detail> pageList = new PageList<Detail>();
        pageList.setTotal(aLong);
        pageList.setData(details);
        return pageList;
    }




    @Override
    public Long count(DetailQuery detailQuery) {
        return detailMapper.count(detailQuery);
    }


}
